in
and out
implement a
counting semaphore such that i) there is at most one tuple in tuplespace, ii)
there is no polling (repeatedly assessing the state of the semaphore to decide
if a process may continue).
ssx = ...
. ssx
can then be used
to fetch
and store
values for a variable
'x'
in workspace ws
thus:
>>> ssx(range(15)) >>> ssx('cat') >>> ssx(3.14) >>> ssx() [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] >>> ssx() 'cat' >>> ssx() 3.1400000000000001
ws
and 'x'
will presumably appear in
...
. The python code ...
may refer to some other
code (i.e., you are not
constrained to implement this with one single expression).